#import "ArcTabViewController.h"
#import "Constants.h"
#import "AllSongsViewController.h"
#import "FavouritesViewController.h"


@interface ArcTabViewController ()

@property (nonatomic, retain) AllSongsViewController * viewControllerOne;
@property (nonatomic, retain) FavouritesViewController * viewControllerFour;

@end


@implementation ArcTabViewController

@synthesize viewControllerOne   = viewControllerOne_,

viewControllerFour  = viewControllerFour_;


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - Override

// Override |KYArcTabViewController|'s |-setup|
- (void)setup {
      // Set View Frame
    //    self.viewFrame = (CGRect){CGPointZero, {kKYViewWidth, kKYViewHeight}};
    self.viewFrame = (CGRect){CGPointZero, {kKYViewWidth, kKYViewHeight}};
    
#pragma mark- Changes on arcTab!
    // Add child view controllers to each tab
    
    viewControllerOne_ = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"allSongs"];
    
    viewControllerFour_ = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"favouriteSongs"];
    
    
    // Set child views' Frame
    CGRect childViewFrame = self.viewFrame;
    [viewControllerFour_.view  setFrame:childViewFrame];
    [viewControllerOne_.view   setFrame:childViewFrame];
    
    
    
    // Add child views as tab bar items
    
    self.tabBarItems = @[@{@"image"          : [NSString stringWithFormat:@"ButtonAllSongs.png"],
                           @"viewController" : viewControllerOne_},
                         @{@"image"          : [NSString stringWithFormat:@"ButtonFavourites.png"],
                           @"viewController" : viewControllerFour_}];
    
}

@end
